<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />


<div class="t_bar">
	人员情况（单位：人）
</div>
	<table  id="zh_persons" border="0" cellspacing="0" cellpadding="0" class="table01" >
		
			<tr >
				<td  align="center"  width="150px" rowspan="2">
					职工总人数
				</td>
				<td align="center" width="150px" rowspan="2" align="center" align="center">
					<span name="organizations/organization[0]/people_count_total"><x:out
								select="$xmlData/data/organization_persons/people_count_total" />
					</span>&nbsp;
					<input type="hidden" value="<x:out select="$xmlData/data/organization_persons/people_count_total" />"  id="people_count_total">
				</td>
				<td width="150px" align="right" rowspan="2">
					大专以上人员人数及占<br/>总人数百分比
				</td>
				<td width="150px" align="center">
					<span name="organizations/organization[0]/degree_total" id="1d1egree_total"><x:out select="$xmlData/data/organizations/organization[@submit_org=1]/degree_total" /></span>
					<input type="hidden" id='degree_college' value="<x:out select='$xmlData/data/organization_persons/degree_college' />">
				    <input type="hidden" id='degree_bachelor' value="<x:out select='$xmlData/data/organization_persons/degree_bachelor' />">
				    <input type="hidden" id='degree_master' value="<x:out select='$xmlData/data/organization_persons/degree_master' />">
				    <input type="hidden" id='degree_doctor' value="<x:out select='$xmlData/data/organization_persons/degree_doctor' />">
				    
				</td>
				<td align="right" width="150px" rowspan="2">
					研究开发人员人数及<br/>总人数百分比
				</td>
				<td width="150px" align="center">
					<span name="organizations/organization[0]/work_yanfa"><x:out select="$xmlData/data/organization_persons/work_yanfa" /></span>&nbsp;
					<input type="hidden" value="<x:out select="$xmlData/data/organization_persons/work_yanfa" />" id="work_yanfa"/>
				</td>
				
			</tr>
			<tr>	
				<td align="center">
					<span name="organizations/organization[0]/degree_total_rate" id="degree_total_rate"></span>&nbsp;
				</td>
				<td align="center">
					<span name="organizations/organization[0]/work_yanfa_rate" id="1wo1rk_yanfa_rate"></span>&nbsp;
				</td>
			</tr>
			
	</table>
	
	<br>
	<div class="t_bar">
	<span class="color_red">*</span>法定代表人情况
	</div>
	<table  id="tblFaren" border="0"  width="100%"  cellspacing="0" cellpadding="0" class="t_css">
		<tr>
			<td align="right"  nowrap>姓名：</td>
			<td ><input type="hidden" name="org_persons/organization_person[00]@psn_type" value="faren">
			<span name="org_persons/organization_person[00]/cname"><x:out select="$xmlData/data/organization_persons/person[@type='faren']/cname"/></span> 
			
			</td>
			<td align="right"  nowrap>性别：</td>
			<td >	
		       <label><input type="radio" name="gender0"  class="do" value="M" label="男" >男</label>
			   <label><input type="radio" name="gender0"  class="do" value="F" label="女" >女</label>
		       <input type="hidden" id='gender_value' name="org_persons/organization_person[00]/gender0_value" class="required"  label="法定代表人情况->性别"  value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='faren']/gender0_value" />">	
			   <input type="hidden" name="org_persons/organization_person[00]/gender0_name" value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='faren']/gender0_name" />">	
		    </td>
		  <td align="right"  nowrap>出生年月：</td>
			<td  nowrap>
			<c:set var="farenbirthday"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='faren']/birthday"/></c:set> 
			<cpt:date id="farenbirthday"   name="org_persons/organization_person[00]/birthday" value="${farenbirthday}" className="required date" label="法定代表人情况->出生年月"></cpt:date>
			</td>
			<td align="right"  nowrap>最高学历：</td>
			<td ><span name="org_persons/organization_person[00]/freducate_background_name"><x:out select="$xmlData/data/organization_persons/person[@type='faren']/educate_background_name"/></span>
			</td>
		</tr>

		<tr>
			<td align="right"  nowrap>手机：</td>
			<td >
				<span name="org_persons/organization_person[00]/mobile"><x:out select="$xmlData/data/organization_persons/person[@type='faren']/mobile"/></span>
			</td>
			
			<td align="right"  nowrap>电话：</td>
			<td >
				<span name="org_persons/organization_person[00]/tel"><x:out select="$xmlData/data/organization_persons/person[@type='faren']/tel"/></span>
			</td>
			<td align="right" nowrap  nowrap>现任职时间：</td>
			<td  colspan="3"  nowrap>
				<c:set var="frserving_time"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='faren']/serving_time"/></c:set> 
			   <cpt:date id="frserving_time" name="org_persons/organization_person[00]/serving_time" value="${frserving_time}"  
				className="required date dateCompareAfterE:frserving_time:farenbirthday" label="法定代表人情况->现任职时间"></cpt:date>
			</td>
		</tr>
		
		<tr>
			<td colspan="8"  nowrap >主要学习工作经历（限300字）</td>
		</tr>
		<tr>
			<td colspan="8">
				<textarea label="法定代表人情况->主要学习工作经历" name="org_persons/organization_person[00]/work_situation" rows="5" cols="150" class="input_textarea required maxlength:300 textarea" ><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='faren']/work_situation" escapeXml="true" /></textarea>
			<input value="" type="hidden" name="org_persons/organization_person[00]/work_situation_hidden"> 
			</td>
			
		</tr>
	
		<tr >
	        <td colspan="8" class="t_bar"><span class="color_red">*</span>主要负责人情况</td>
	     </tr>
	
		<tr>
			<td align="right"  nowrap>姓名：</td>
			<td >
			<input type="hidden" name="org_persons/organization_person[01]@psn_type" value="fuzeren">
			<span name="org_persons/organization_person[01]/cname">
			<x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/cname"/>
			</span>
			</td>
			<td align="right"  nowrap>性别：</td>
			<td >
			<label><input type="radio" name="gender01"  class="do" value="M" label="男" >男</label>
			<label><input type="radio" name="gender01"  class="do" value="F" label="女" >女</label>
			<input type="hidden" id="gender01_value" class="required"  label="主要负责人情况->性别" name="org_persons/organization_person[01]/gender01_value" value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='fuzeren']/gender01_value" />">
			<input type="hidden" id="gender01_name" name="org_persons/organization_person[01]/gender01_name" value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='fuzeren']/gender01_name" />">
		    </td>
			<td align="right"  nowrap>出生年月：</td>
			<td  nowrap>
			<c:set var="fuzerenbirthday"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='fuzeren']/birthday"/></c:set> 
			<cpt:date id="fuzerenbirthday" name="org_persons/organization_person[01]/birthday" value="${fuzerenbirthday}"  
				className="required date" label="主要负责人情况->出生年月"></cpt:date>
           </td>
			<td align="right"  nowrap>最高学历：</td>
			<td >
			<span name="org_persons/organization_person[01]/fzreducate_background_name">
			<x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/educate_background_name"/>
			</span>
			</td>
		</tr>
		<tr>
			<td align="right"  nowrap>手机：</td>
			<td >
				<span name="org_persons/organization_person[01]/mobile">
				<x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/mobile"/>
				</span>
			</td>
			
			<td align="right"  nowrap>电话：</td>
			<td >
				<span name="org_persons/organization_person[01]/tel">
				<x:out select="$xmlData/data/organization_persons/person[@type='fuzeren']/tel"/>
				</span>
			</td>
			<td align="right" nowrap >现任职时间：</td>
			<td colspan="3"  nowrap>
				<c:set var="fzrservingtime"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='fuzeren']/serving_time"/></c:set> 
			<cpt:date id="fzrservingtime" name="org_persons/organization_person[01]/serving_time" value="${fzrservingtime}" size="10" 
				className="required date dateCompareAfterE:fzrservingtime:fuzerenbirthday" label="主要负责人情况->现任职时间"></cpt:date>	
			</td>
		</tr>
		
		<tr>
			<td colspan="8"  nowrap >主要学习工作经历（限300字）</td>
		</tr>
		<tr>
			<td colspan="8">
				<textarea name="org_persons/organization_person[01]/work_situation" rows="5" cols="150" class="input_textarea required maxlength:300 textarea" required label="主要负责人情况->主要学习工作经历" ><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='fuzeren']/work_situation" escapeXml="true" /></textarea>
			<input value="" type="hidden" name="org_persons/organization_person[01]/work_situation_hidden"> 
			</td>
			
		</tr>
		
		<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
		<tr name="tblProjectFuzeren">
	        <td colspan="8" class="t_bar"><span class="color_red">*</span>项目主要负责人员情况</td>
	    </tr>
		<tr name="tblProjectFuzeren">
			<td align="right"  nowrap>姓名：</td>
			<td >
			<input type="hidden" name="org_persons/organization_person[02]@psn_type" value="project">
			<input disabled="disabled" type="text" name="org_persons/organization_person[02]/cname" class="required " label="项目主要负责人员情况->姓名" maxlength="50"
				  value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/cname"/>" />
			<input type="hidden" name="cname" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/zh_name"/>">
			
			<span id="personSelect">
			<input type="button" class="button_02" style="height: 25px; padding: 1px;" id="selectPsn" value="设置">
			<cpt:personSelect key="personSelect" addRole="3" callback="selectPsnCall" bindEvent="click" bindObject="selectPsn" title="设置项目主要负责人员" fltFile="personSelector.ftl"></cpt:personSelect>
			</span>
			</td>
		   	<td align="right"  nowrap>性别：</td>
			<td >
				<label><input type="radio" name="gender02"  id="gender02radio1" class="do" value="男" label="男" >男</label>
			   	<label><input type="radio" name="gender02"  id="gender02radio2" class="do" value="女" label="女" >女</label>
		       	<input type="hidden" id='gender_value' name="org_persons/organization_person[02]/gender02_value" class="required"  label="项目主要负责人员情况->性别"  value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/gender02_value" />">	
			   	<input type="hidden" id="gender3_name" name="org_persons/organization_person[02]/gender02_name" value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/gender02_name" />">	
		        <input type="hidden" name="gender02_value" id='gender02_value' value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/gender_value" />">
		         <script type="text/javascript">
	            $(function() {
		             var gender3=$("#gender_value").val();
		             var gender3_value=$("#gender02_value").val();
		             if(gender3_value=='M'&&gender3==''){
		            	 $("#gender02radio1").attr("checked",true);
		            	 $("#gender3_name").val("男");
		             }
		             if(gender3_value=='F'&&gender3==''){
		            	 $("#gender02radio2").attr("checked",true);
		            	 $("#gender3_name").val("女");
		             }
		            
	            });
            </script> 
		    </td>
			<td align="right"  nowrap>出生年月：</td>
			<td  nowrap>
				<c:set var="projectbirthday"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/birthday"/></c:set> 
			    <cpt:date id="projectbirthday" name="org_persons/organization_person[02]/birthday" value="${projectbirthday}" size="16" 
				   className="required date" label="项目主要负责人员情况->出生年月"></cpt:date>
			    <input type="hidden" name="birthday" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/birthday" />">	
			</td>
			<td align="right"  nowrap>最高学历：</td>
			<td >
				<c:set var="peducate"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/peducate_background_value"/></c:set>
				<cpt:select id="peducate_background"  key="educate"  className="select_width" value="${peducate}" ></cpt:select>
				<input type="hidden" name="org_persons/organization_person[02]/peducate_background_value"  class="required" value="${peducate}" label="项目主要负责人员情况->最高学历">
				<input type="hidden" name="org_persons/organization_person[02]/peducate_background_name" value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/peducate_background_name" />">
				<input type="hidden" name="peducate_background_value" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_value" />">
				<input type="hidden" name="peducate_background_name" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_name" />">
			</td>
			
		</tr>
		<tr name="tblProjectFuzeren">
			<td align="right"  nowrap>手机：</td>
			<td >
				<input type="text" name="org_persons/organization_person[02]/mobile" class="required mobile" label="项目主要负责人员情况->手机" maxlength="11"
					value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/mobile"/>"/>
				<input type="hidden" name="mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person/contact/mobile" />">
			</td>
			
			<td align="right"  nowrap>电话：</td>
			<td >
				<input type="text" name="org_persons/organization_person[02]/tel" class="required " label="项目主要负责人员情况->电话" maxlength="20"
					value="<x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/tel"/>"/>
				<input type="hidden" name="tel" value="<x:out select="$xmlData/data/zh_persons/zh_person/contact/tel_work" />">
			</td>
			<td align="right" nowrap  nowrap>现任职时间：</td>
			<td colspan="3"  nowrap>
				<c:set var="pserving_time"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/serving_time"/></c:set> 
			<cpt:date id="pserving_time" name="org_persons/organization_person[02]/serving_time" value="${pserving_time}"  
				className="required date dateCompareAfterE:pserving_time:projectBirthday" label="项目主要负责人员情况->现任职时间"></cpt:date>
				
			</td>
		</tr>
		<tr name="tblProjectFuzeren">
			<td colspan="8"  nowrap >主要学习工作经历（限300字）</td>
		</tr>
		<tr name="tblProjectFuzeren">
			<td colspan="8">
				<textarea name="org_persons/organization_person[02]/work_situation" rows="5" cols="150" class="input_textarea required maxlength:300 textarea" label="项目主要负责人员情况->主要学习工作经历" ><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/work_situation" escapeXml="true" /></textarea>
			<input value="" type="hidden" name="org_persons/organization_person[02]/work_situation_hidden"> 
			</td>
			
		</tr> 
		</security:authorize>
		
		<security:authorize ifNotGranted="A_DAILU_PROPOSAL">
		<tr>
	        <td colspan="8" class="t_bar"><span class="color_red">*</span>项目主要负责人员情况</td>
	    </tr>
		<tr>
			<td align="right"  nowrap>姓名：</td>
			<td >
			<input type="hidden" name="org_persons/organization_person[02]@psn_type" value="project">
			<span name="org_persons/organization_person[02]/cname"><x:out select="$xmlData/data/zh_persons/zh_person/basic_info/zh_name"/></span>
			</td>
		   <td align="right"  nowrap>性别：</td>
			<td ><span  name="org_persons/organization_person[02]/gender02_name">
			<c:set var="gender_value" ><x:out select="$xmlData/data/zh_persons/zh_person/basic_info/gender_value" /></c:set>
			<c:choose>
				<c:when test="${gender_value eq 'M' }">男</c:when>
				<c:otherwise>女</c:otherwise>
			</c:choose></span>
		    </td>
			<td align="right"  nowrap>出生年月：</td>
			<td  nowrap>
			<span name="org_persons/organization_person[02]/birthday"><x:out select="$xmlData/data/zh_persons/zh_person/basic_info/birthday" /></span>
			<input id="projectBirthday" type="hidden" label="项目主要负责人员情况->出生年月" value="<x:out select="$xmlData/data/zh_persons/zh_person/basic_info/birthday" />">
			</td>
			<td align="right"  nowrap>最高学历：</td>
			<td >
			<span name="org_persons/organization_person[02]/peducate_background_name"><x:out select="$xmlData/data/zh_persons/zh_person/basic_info/educate_name" /></span>
			</td>
			
		</tr>
		<tr>
			<td align="right"  nowrap>手机：</td>
			<td >
				<span name="org_persons/organization_person[02]/mobile"><x:out select="$xmlData/data/zh_persons/zh_person/contact/mobile" /></span>
			</td>
			
			<td align="right"  nowrap>电话：</td>
			<td >
				<span name="org_persons/organization_person[02]/tel"><x:out select="$xmlData/data/zh_persons/zh_person/contact/tel_work" /></span>
			</td>
			<td align="right" nowrap  nowrap>现任职时间：</td>
			<td colspan="3"  nowrap>
				<c:set var="pserving_time"><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/serving_time"/></c:set> 
			<cpt:date id="pserving_time" name="org_persons/organization_person[02]/serving_time" value="${pserving_time}"  
				className="required date dateCompareAfterE:pserving_time:projectBirthday" label="项目主要负责人员情况->现任职时间"></cpt:date>
				
			</td>
		</tr>
		<tr>
			<td colspan="8"  nowrap >主要学习工作经历（限300字）</td>
		</tr>
		<tr>
			<td colspan="8">
				<textarea name="org_persons/organization_person[02]/work_situation" rows="5" cols="150" class="input_textarea required maxlength:300 textarea" label="项目主要负责人员情况->主要学习工作经历" ><x:out select="$xmlData/data/org_persons/organization_person[@psn_type='project']/work_situation" escapeXml="true" /></textarea>
			<input value="" type="hidden" name="org_persons/organization_person[02]/work_situation_hidden"> 
			</td>
			
		</tr> 
		</security:authorize>
	   	
	</table>
<script type="text/javascript">
      $(function() {
         var degree_college=$("#degree_college").val();
         var degree_bachelor=$("#degree_bachelor").val();
         var degree_master=$("#degree_master").val();
         var degree_doctor=$("#degree_doctor").val();
         var count=parseInt(degree_college)+parseInt(degree_bachelor)+parseInt(degree_master)+parseInt(degree_doctor);
    
         $("#1d1egree_total").html(count);
        
         var people_count_total = parseInt($("#people_count_total").val());
         var degree_total_rate = count*100/people_count_total;
         degree_total_rate= formatNumberAuto(degree_total_rate.toString(), 9, 2, 2);
         $("#degree_total_rate").html(degree_total_rate + "%");
         var work_yanfa = $("#work_yanfa").val();
         
         var work_yanfa_rate = parseInt(work_yanfa)*100/parseInt(people_count_total);
         work_yanfa_rate = formatNumberAuto(work_yanfa_rate.toString(), 9, 2, 2);
         $("#1wo1rk_yanfa_rate").html(work_yanfa_rate + "%");
         
         //initPersonValue("tblFaren");
        // initPersonValue("tblfuzeren");
        // initPersonValue("tblProjectFuzeren");
      });
      
      function initPersonValue(tblName){
    	  var tbl = $("#" + tblName);
    	 
    	  tbl.find("input[type=hidden]").each(function(){
    			var id=$(this).attr("name");
    			
    			if(id==null || id=="")
    				return true;
    			var parentObj=tbl.find("[name$='/"+id+"']");
    			
    			if(parentObj.val() == null || $.trim(parentObj.val()) == ""){
    				var value= $(this).val();
	    			parentObj.val(value);
    			}
    			
    		});
    	  
      }
</script>

<security:authorize ifAnyGranted="A_DAILU_PROPOSAL">
<script type="text/javascript">
<!--
$(document).ready(function(){
	var tbl = $("tr[name='tblProjectFuzeren']");
	tbl.find("input[type=hidden]").each(function(){
		var id=$(this).attr("name");
		
		if(id==null || id=="")
			return true;
		var parentObj=tbl.find("[name$='/"+id+"']");
		
		if(parentObj.val() == null || $.trim(parentObj.val()) == ""){
			var value= $(this).val();
 			parentObj.val(value);
		}
		
	});
});
//选择机构负责人回调
function selectPsnCall(data) {
	var tblProjectFuzeren = $("tr[name='tblProjectFuzeren']");
	$("input[name$='psn_code']").val(data.person.psnCode);
	tblProjectFuzeren.find("input[name$='cname']").val(data.person.zhName);
	var gender = data.personExtend.basic_info.gender_value;
	if (gender == 'M') {
		gender = "男";
	} else {
		gender = "女";
	}
	tblProjectFuzeren.find("input[name$='gender02'][value='"+gender+"']").attr("checked","checked");
	tblProjectFuzeren.find("input[name$='gender02_value']").val(gender);
	tblProjectFuzeren.find("input[name$='gender02_name']").val(gender);
	tblProjectFuzeren.find("input[name$='birthday']").val(data.personExtend.basic_info.birthday);
	//tblProjectFuzeren.find("input[name$='position']").val(data.personExtend.basic_info.position);
	tblProjectFuzeren.find("input[name$='tel']").val(data.personExtend.contact.tel_work);
	tblProjectFuzeren.find("input[name$='mobile']").val(data.personExtend.contact.mobile);
	//tblProjectFuzeren.find("input[name$='major']").val(data.personExtend.contact.major);
	$("#peducate_background").val(data.personExtend.basic_info.educate_value);
	tblProjectFuzeren.find("input[name$='peducate_background_value']").val(data.personExtend.basic_info.educate_value);
	tblProjectFuzeren.find("input[name$='peducate_background_name']").val(data.personExtend.basic_info.educate_name);
	tb_remove2();
}
//-->
</script>
</security:authorize>